From: Cosimo Cecchi Date: Wed, 7 Jan 2015 10:16:04 +0000 (+0800) Subject: search: remove redundant check X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1914 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8345fe006e397492acb21df36be923a1538b6b57;p=gnome-shell.git search: remove redundant check We check for (metasNeeded.length == 0) at the beginning of the function, which is only ever called when when a non-zero number of results is received back from the provider. Effectively, this means that (metas.length != metasNeeded.length) will also catch (metas.length == 0) and print a nicer message to the log. --- diff --git a/js/ui/search.js b/js/ui/search.js index 4737c8232..7e7cb83fa 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -199,10 +199,6 @@ const SearchResultsBase = new Lang.Class({ this._cancellable.reset(); this.provider.getResultMetas(metasNeeded, Lang.bind(this, function(metas) { - if (metas.length == 0) { - callback(false); - return; - } if (metas.length != metasNeeded.length) { log('Wrong number of result metas returned by search provider ' + this.provider.id + ': expected ' + metasNeeded.length + ' but got ' + metas.length);